package org.zjt.spring.test.demo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ImportResource;
import org.zjt.spring.test.demo.common.ThrowableWrapper;
import org.zjt.spring.test.demo.service.UserService;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

@SpringBootApplication
@ImportResource({"classpath:spring.xml"})
@Slf4j
public class DemoApplication {

	/**
	 * main 方法会被执行两次，第一次是main启动，第二次为devtools启动
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {

		//
		new Exception().printStackTrace();





		ConfigurableApplicationContext configurableApplicationContext = SpringApplication.run(DemoApplication.class, args);


		UserService bean = configurableApplicationContext.getBean("instanceFactoryBean1",UserService.class);
		bean.echo("zssshangsan");


	}




}
